package com.hbnu.system;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Slf4j
@SpringBootApplication
@MapperScan("com.hbnu.system.mapper")
//启动事务
@EnableTransactionManagement(proxyTargetClass = true)
public class SystemApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext application = SpringApplication.run(SystemApplication.class, args);
        Environment env = application.getEnvironment();
        log.info("\n----------------------------------------------------------\n\t" +
                        "应用文档启动成功! 访问连接:\n\t" +
                        "Swagger文档: \t\thttp://localhost:{}/doc.html\n" +
                        "----------------------------------------------------------",
                env.getProperty("server.port"));

    }
}